$(function(){
	$(function() {
		loadClass($("select[name='newsClassId']"));
	});
	
	let loadClass = function(selectObj, fn = function() {}) {
		$.get(
			"news-class-json.do",
			function(data) {
				$.each(data, function(name, item) {
					$("<option></option>").text(item.newsClassName)
						.val(item.newsClassId).appendTo(selectObj);
				});
				fn();
			}, "json"
		);
	}
});